import i18n from '@/utils/i18n'
export const formItems = [
    {
        filed: 'payMethod',
        type: 'select',
        label: i18n.t('message.czfs'),
        labelCode: 'name',
        options: []
    },

    {
        filed: 'memberInfo',
        type: 'input',
        label: i18n.t('message.memberInfo'),
        placeholder: i18n.t('message.hy2')
    },
    {
        filed: 'time',
        type: 'daterange',
        clearable: false,
        label: i18n.t('message.czrq'),
        pickerOptions: {
            shortcuts: [{
                text: i18n.t('message.jin7'),
                onClick (picker) {
                    const end = new Date()
                    const start = new Date()
                    end.setTime(end.getTime())
                    start.setTime(start.getTime() - 3600 * 1000 * 24 * 6)
                    picker.$emit('pick', [start, end])
                }
            },
            {
                text: i18n.t('message.jin30'),
                onClick (picker) {
                    const end = new Date()
                    const start = new Date()
                    end.setTime(end.getTime())
                    start.setTime(start.getTime() - 3600 * 1000 * 24 * 29)
                    picker.$emit('pick', [start, end])
                }
            },
            {
                text: i18n.t('message.jin60'),
                onClick (picker) {
                    const end = new Date()
                    const start = new Date()
                    end.setTime(end.getTime())
                    start.setTime(start.getTime() - 3600 * 1000 * 24 * 59)
                    picker.$emit('pick', [start, end])
                }
            },
            {
                text: i18n.t('message.jin90'),
                onClick (picker) {
                    const end = new Date()
                    const start = new Date()
                    end.setTime(end.getTime())
                    start.setTime(start.getTime() - 3600 * 1000 * 24 * 89)
                    picker.$emit('pick', [start, end])
                }
            }],
            disabledDate (time) {
                var curDate = new Date(new Date().toLocaleDateString()).getTime()
                var preDate = new Date(curDate)
                return time.getTime() > preDate
            }
        }
    },
    {
        filed: 'creator',
        type: 'input',
        label: i18n.t('message.czr')
    },
    {
        filed: 'orderNo',
        type: 'input',
        label: i18n.t('message.ddh')
    },
    {
        filed: 'channel',
        type: 'select',
        label: i18n.t('message.czqd'),
        labelCode: 'name',
        options: []
    },
    {
        filed: 'orderType',
        type: 'select',
        label: i18n.t('message.ddlx'),
        options: [
            { value: '05', label: i18n.t('message.hykk') },
            { value: '01', label: i18n.t('message.hycz') }
        ]
    }
]
export const queryFormConfig = {
    formItems,
    online: true
}
